﻿<UserControl x:Class="Jbe.TestSuite.LogViewer.Presentation.LogView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:v="clr-namespace:Jbe.TestSuite.LogViewer.Presentation"
    xmlns:p="clr-namespace:Jbe.TestSuite.LogViewer.Properties"         
    xmlns:i="http://www.codeplex.com/CompositeExtensions/TestSuite/Interface"
    xmlns:cae="http://www.codeplex.com/CompositeExtensions"
    cae:ResourceService.MergeSharedDictionaries="{x:Static i:ResourceHelper.SharedResourcePath}">
    
    <DockPanel>
        <StackPanel DockPanel.Dock="Top">
            <ToolBar>
                <Button Command="{Binding StartCommand}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../Resources/PlayHS.png" Height="16" Width="16" Margin="0,0,2,0"/>
                        <TextBlock Text="{x:Static p:Resources.Start}" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Command="{Binding StopCommand}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../Resources/StopHS.png" Height="16" Width="16" Margin="0,0,2,0"/>
                        <TextBlock Text="{x:Static p:Resources.Stop}" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Button Command="{Binding ClearCommand}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../Resources/Clear.png" Height="16" Width="16" Margin="0,0,2,0"/>
                        <TextBlock Text="{x:Static p:Resources.Clear}" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <Separator/>
                <TextBlock Text="{Binding LogEntries.Count, Converter={x:Static v:LogEntriesCountConverter.Default}}" Style="{StaticResource ToolBar.TextBlock}"/>
            </ToolBar>
        </StackPanel>
       
        <ListView ItemsSource="{Binding LogEntries, IsAsync=true}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="{x:Static p:Resources.Severity}" DisplayMemberBinding="{Binding Severity}"/>
                    <GridViewColumn Header="{x:Static p:Resources.TimeStamp}" DisplayMemberBinding="{Binding TimeStamp}"/>
                    <GridViewColumn Header="{x:Static p:Resources.Message}" DisplayMemberBinding="{Binding Message}"/>
                    <GridViewColumn Header="{x:Static p:Resources.Categories}" DisplayMemberBinding="{Binding Categories, Converter={x:Static v:StringArrayToStringConverter.Default}}"/>
                    <GridViewColumn Header="{x:Static p:Resources.Priority}" DisplayMemberBinding="{Binding Priority}"/>
                    <GridViewColumn Header="{x:Static p:Resources.EventId}" DisplayMemberBinding="{Binding EventId}"/>
                </GridView>
            </ListView.View>
        </ListView>
    </DockPanel>
</UserControl>
